﻿using ExamServer.Entities;
using Microsoft.EntityFrameworkCore;
using System;
using System.Threading.Tasks;

namespace ExamServer.Service
{
    public class UsersRepository :RepositoryBase<Users,Guid>, IUsersRepository
    {
      

        public UsersRepository(DbContext dbContext):base(dbContext)
        {
            
        }

        public async Task<Users> Login(string name, string pwd)
        {
            var user = await dbContext.Set<Users>().FirstOrDefaultAsync(
                x=>x.Name==name&&
                x.Password==pwd);
            return user;                 
        }
    }
}